/*  1:   */ package org.jetbrains.rpc;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.util.ActionCallback;
import org.jetbrains.annotations.Nullable;

/*  4:   */
/*  5:   */
/*  6:   */ 
/*  7:   */ abstract class AsyncResultCallbackBase<SUCCESS_RESPONSE, C extends ActionCallback, ERROR_DETAILS>
/*  8:   */   implements AsyncResultCallback<SUCCESS_RESPONSE, ERROR_DETAILS>
/*  9:   */ {
/* 10:   */   protected final C callback;
/* 11:   */   private final ErrorConsumer<C, ERROR_DETAILS> a;
/* 12:   */   
/* 13:   */   protected AsyncResultCallbackBase(C paramC, @Nullable ErrorConsumer<C, ERROR_DETAILS> paramErrorConsumer)
/* 14:   */   {
/* 15:11 */     this.callback = paramC;
/* 16:12 */     this.a = paramErrorConsumer;
/* 17:   */   }
/* 18:   */   
/* 19:   */   public final void onError(String paramString, ERROR_DETAILS paramERROR_DETAILS)
/* 20:   */   {
/* 21:   */     try
/* 22:   */     {
/* 23:18 */       if (this.a == null) {
/* 24:19 */         this.callback.reject(paramString);
/* 25:   */       } else {
/* 26:   */         try
/* 27:   */         {
/* 28:23 */           this.a.consume(paramString, paramERROR_DETAILS, this.callback);
/* 29:   */         }
/* 30:   */         catch (Throwable localThrowable1)
/* 31:   */         {
/* 32:   */           try
/* 33:   */           {
/* 34:27 */             this.callback.reject(localThrowable1.getMessage());
/* 35:   */           }
/* 36:   */           finally
/* 37:   */           {
/* 38:30 */             MessageManager.LOG.error(localThrowable1);
/* 39:   */           }
/* 40:   */         }
/* 41:   */       }
/* 42:   */     }
/* 43:   */     catch (Throwable localThrowable2)
/* 44:   */     {
/* 45:36 */       MessageManager.LOG.error(localThrowable2);
/* 46:   */     }
/* 47:   */   }
/* 48:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.rpc.AsyncResultCallbackBase

 * JD-Core Version:    0.7.0.1

 */